from fastapi import FastAPI, Body
import uvicorn

app = FastAPI()


@app.put("/test")
def put_test(data: str = None):
    print("recv:", data)
    return {"recv_data": data}


@app.put("/test_v2")
def put_test_v2(data: dict = Body(...)):
    print("recv:", data)
    return {"recv_data": data}


if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)
